package com.hutool.text.console;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileReader;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import org.junit.Test;



import java.util.List;

public class FileTest {

    @Test
    public void testFile(){
        //默认UTF-8编码，可以在构造中传入第二个参数做为编码
        FileReader fileReader = new FileReader("C:\\Users\\80795\\Desktop\\简历.txt","utf-8");
        String result = fileReader.readString();
        System.out.println(  result);
        List<String> strings = fileReader.readLines();
        System.out.println("strings = " + strings);

        ExcelReader reader = ExcelUtil.getReader(FileUtil.file("C:\\Users\\80795\\Desktop\\数据字典.xlsx"),0);
        List<List<Object>> read = reader.read();
        for (List<Object> objects : read) {
            System.out.println("objects = " + objects);
        }
    }
}
